package com.mall.action;

import com.github.pagehelper.PageInfo;
import com.mall.bean.Order;
import com.mall.bean.QueryWhereVO;
import com.mall.service.OrderService;
import com.mall.uitl.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lwd1513
 * @date 2022-04-25 15 03
 * discription
 */
@RestController
@RequestMapping("/Index/OrderController2")
public class OrderController2 {
    @Autowired
    private OrderService orderService;
    @RequestMapping("/query")
    public JsonUtil query(QueryWhereVO queryWhereVO, @RequestParam("member_id") String memberId, String state) {
        String currentPage = queryWhereVO.getCurrentPage();
        String pageSize = queryWhereVO.getPageSize();
        PageInfo<Order> pageInfo = orderService.queryDataByPageById(currentPage, pageSize, memberId);
        JsonUtil jsonUtil = new JsonUtil();
        jsonUtil.setData(pageInfo);
        return jsonUtil;
    }
}
